package com.webermagem.DAO;

import java.io.Serializable;

import org.hibernate.Query;
import org.hibernate.Session;

import com.webermagem.util.HibernateUtil;

public class UsuarioDAO extends GenericDAO implements Serializable{


	private static final long serialVersionUID = 2222451465499989512L;


	public UsuarioDAO(){
		
	}
	

	public Object getByUsername(String username, Object objeto) {
		Session session = HibernateUtil.getSessionFactory().openSession();
		
		Query query = session.createQuery("from UsuarioSessao where username = :username ");
		query.setParameter("username", username);
		Object objetoRetornado = query.uniqueResult();
		
		return objetoRetornado;
	}
	
}
